/*
 * Version 0.2.1
 *
 * Copyright (c) 2010 Guet
 *
 * All rights reserved.
 *
 * Developed by: XGuru
 *
 */
#include <time.h>
#include <string.h>
#include <stdint.h>

struct hashtable
{
    struct hashentry **table;
    unsigned int size;
    struct hashentry *spares;
};

struct hashentry
{
    struct hashentry *next;
    char *key;
    char *value;
    unsigned int exptime;
    time_t init_time;
    int length;
    int flag;
};

struct hashtable *hash_init (unsigned int size);
void hash_free (struct hashtable *tablestruct);
unsigned int hash_hash(char *key);
struct hashentry *hash_lookup (struct hashtable *tablestruct, char *key);
int hash_insert (struct hashtable *tablestruct,char *key,int flag,unsigned int exptime,int length,char *value);
int hash_remove (struct hashtable *tablestruct, char *key);
